POV-Ray : Newsgroups : povray.programming : Adding a keyword : Adding a keyword Server Time
8 Jul 2024 19:15:15 EDT (-0400)
  Adding a keyword  
From: Florian Brucker
Date: 22 Jan 2003 12:17:10
Message: <3e2ed216@news.povray.org>
hey guys!

I was just playing with the pov sources and tried to add a new keyword to
the global_settings block.

I added a token to TOKEN_IDS in parse.h and added a reserved word to
Reserved_Words in tokenize.cpp. I also added a CASE-block into
Parse_Global_Settings in parse.cpp (just a dummy one which states a
warning).

Everything is ok so far and POV compiles fine. But if i use my keyword in
the global_settings block it is taken as a float function:


<Parse_Global_Settings in parse.cpp>
//snip
CASE (INI_IMAGE_WIDTH_TOKEN)
{
    //Dummy stuff
    int MyDummy = (int) Parse_Float();
    Warning(0,"You used ini_image_width\n");
}
END_CASE
//snap
</Parse_Global_Settings>


<sdl>
global_settings {
    ini_image_width 640
}
</sdl>


<message window>
Parse Error: No matching } in 'global_settings', float function
'ini_image_width' found instead
</message window>


I want something like hf_gray_16, a keyword followed by a integer value.
What do I have to do to make POV-Ray accept this?

thanks in advance,
Florian

P.S.: If I do something completely wrong and you think I should do anything
but trying to patch POV, feel free to tell me ;-)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.